app.controller('eshartsCtrlB',['$scope','homeService',function ($scope,homeService) {
    var data = JSON.parse(homeService.getData());
        $scope.chartParam3 = {index:data.data.items[0].CHECK_RATE,title:'排查率'};

}]);
app.directive('lineB', function(){
    return {
        scope: {
            id:'@',
            chartParam3:'='
        },
        restrict: 'E',
        template: '<div style="width:100%;height:100%;"></div>',
        replace: true,
        link: function($scope, element, attrs, controller) {
            console.log()
            var option = {
                backgroundColor: '#FFFFFF',
                series: [
                    {
                        axisLine: {
                            show: true,
                            lineStyle: {
                                color: [
                                    [0.2, '#F05436'],
                                    [0.4, '#F1A337'],
                                    [0.6, '#F7F3AA'],
                                    [0.8, '#7A9BD1'],
                                    [1.0, '#B5D7A5']
                                ],
                                width: 13
                            }
                        },
                        axisTick: {
                            show: true
                        },
                        axisLabel: {
                            distance: 6,
                            textStyle: {
                                color: 'auto'
                            }
                        },
                        splitLine: { //分割线样式
                            length: 13,
                            lineStyle: {
                                width: 1
                            }
                        },
                        itemStyle: {
                            normal: {
                                color: '#7A9BD1'
                            }
                        },
                        radius: '90%',
                        pointer: {
                            width: 6
                        },
                        title: {
                            textStyle: {
                                fontWeight: '',
                                fontSize: 13,
                                color: '#000000'
                            },
                            offsetCenter: [0, '85%']
                        },
                        detail: {

                            textStyle: {
                                fontWeight: '',
                                fontSize: 13,
                                color: '#7A9BD1'
                            },
                            offsetCenter: [0, '50%'],
                            formatter: '{value}%'
                        },
                        name: '米类仪表盘',
                        type: 'gauge',
                        show: false,
                        splitNumber: 10,
                        data: [{
                            value: $scope.$parent.chartParam3.index,
                            name: $scope.$parent.chartParam3.title
                        }]
                    }]
            }
//
            var myChart = echarts.init(document.getElementById($scope.id),'macarons');
            myChart.setOption(option);
        }
    };
});